Miscellaneous Functions

In this section are found functions that do seem to fit neatly into any of the other sections.

p4_version
\begin{example}
char *p4_version()
\end{example}
returns a string containing the version number of p4 being run.

p4_get_cluster_masters
\begin{example}
VOID p4_get_cluster_masters(numids, ids)
int *numids, ids[];
\end{example}
This procedure fills in the values of numids and ids. It obtains the p4-ids of all ``cluster masters'' for the program, placing them in the ids array and placing the number of ids in numids.

p4_print_avail_buffs
\begin{example}
VOID p4_print_avail_buffs()
\end{example}
P4 maintains an array of buffer lists of various sizes, so that it can very rapidly allocate and deallocate buffers. You can see the contents of the buffer pools at any time by calling this procedure.

buffer pool management p4_set_avail_buff
\begin{example}
VOID p4_set_avail_buff(bufidx,size)
int bufidx;
int size;
\end{example}
This procedure is used to set the size of buffers in p4's buffer pools. The parameter bufidx specifies a particular buffer list, and should be a number from 0 to 7. The size parameter specifies that buffers up to that size will be managed by p4 in a particular list. It is important to maintain the buffer sizes in increasing order. The default list of buffer sizes is 64, 256, 1024, 4096, 16384, 65536, 262144, 1048576. This causes wasted space if you send only one large message, causing the allocation of a large buffer which is not reused. Savings in space can be achieved by adjusting these numbers to correspond with the message sizes of your application. If no large messages are sent at all, however, no space is wasted since the large buffers will never be allocated. If you send a message larger that the largest size in this array, p4 will allocate the buffer, and then free it back to the system as soon as it can.

Fortran Interface,Faster Startup with the Secure Server,Miscellaneous Functions,Top